home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best of Shareware
/
Best of PC Windows Shareware 1.0 - Wayzata Technology (7111) (1993).iso
/
mac
/
DOS
/
PROGRAMG
/
ULTRA250
/
UW_HELP1.HLP
< prev
next >
Wrap
Text File
|
1992-11-03
|
31KB
|
715 lines
`co(4,7);─────────────────────────── /// Structures/Globals ───────────────────────────`color();
┌──────────────────────────────────────────────────────────────────────────┐
│ `keyword(RECT,/// RECT); `keyword(WINDOW,/// WINDOW); │
│ `keyword(EVENT,/// EVENT); `keyword(M_RESET,/// M_RESET); │
│ `keyword(M_LOC,/// M_LOC); `keyword(M_MOVE,/// M_MOVE); │
│ `keyword(PRINT,/// PRINT); `keyword(MENU,/// MENU); │
│ `keyword(Video Globals,/// Video Globals); `keyword(Event Globals,/// Event Globals); │
│ `keyword(Default Attributes,/// Default Attributes); `keyword(Cursor Globals,/// Cursor Globals); │
│ `keyword(DesqView Globals,/// DesqView Globals); `keyword(Manager Globals,/// Manager Globals); │
│ `keyword(Function Globals,/// Function Globals); `keyword(Printer Globals,/// Printer Globals); │
│ `keyword(Timer Globals,/// Timer Globals); `keyword(Graphics Globals,/// Graphics Globals); │
│ `keyword(EGA/VGA Globals,/// EGA/VGA Globals); │
└──────────────────────────────────────────────────────────────────────────┘
These are the structures and global variables that are used in the
UltraWin library. The structures defined are used for windowing, mouse
and printer support. The globals are used for screen and video,
Desqview/Windows compatibility, graphics, timer and sound control,
background processing, dynamically queued RAM-based or disk-based
printing, and the window manager. Include the UW.H file for access to the
structures, and the UW_GLOBX.H file for access to the globals.
`co(10,1);/// RECT`co();
`co(11,1); typedef struct rect_struct
{
int x_min, x_max, y_min, y_max;
} RECT;`co();
This structure is used for general screen and window area definition,
and is used internally by the WINDOW structure. We supply several useful
rectangle functions you may wish to utilize in your own code. Refer to
the `keyword(Rectangle Functions,[uw_help4.hlp]/// Rectangle Functions); section for more information.
`co(10,1);/// WINDOW`co();
`co(15,?); typedef struct w_struct
{
struct w_struct *next; /* next window in linked list */
struct w_struct *previous; /* previous window in list */
RECT pane; /* the window rectangle */
RECT old_pane; /* for full size toggle */
int rows; /* save buffer rows and columns */
int cols;
int csr_x; /* the "soft" cursor location */
int csr_y;
uchar att; /* the window's attribute */
uchar bdr_att; /* the window's border attribute */
int bdr_style; /* the border style */
int name_loc; /* CENTERED, LEFTJUST, RIGHTJUST */
char *name; /* pointer to window name */
uchar *save; /* pointer to save buffer area */
uchar *buff; /* pointer to write buffer area */
uchar *mask; /* pointer to window buffer mask */
uchar *tabs; /* tab stops */
int reg_s, reg_e; /* scroll region start and end */
unsigned hidden : 1; /* 1 if window hidden */
unsigned overlapped : 1; /* 1 if window overlapped */
unsigned csr_adv : 1; /* 1 if cursor auto advanced */
unsigned inside : 1; /* 1 if bordered and inside */
unsigned mask_on : 1; /* 1 if window mask is active */
unsigned popup : 1; /* 1 if window is popup */
unsigned scroll : 1; /* 1 if window auto-scrolls */
unsigned bs_clear : 1; /* 1 if backspace is destructive */
unsigned eol_wrap : 1; /* 1 if cursor wraps at end of ln*/
unsigned mgr_flag : 1; /* 1 if win in manager's list */
unsigned set_flag : 1; /* 1 if window is set on screen */
unsigned cr_flag : 1; /* 1 if cr processed */
unsigned lf_flag : 1; /* 1 if lf processed */
unsigned cr_lf_flag : 1; /* 1 if cr or lf act as cr/lf */
unsigned bk_flag : 1; /* 1 if backspace processed */
unsigned tab_flag : 1; /* 1 if tab processed */
unsigned bell_flag : 1; /* 1 if bell char processed */
unsigned w_wrap : 1; /* 1 if word wrap on */
unsigned unused : 14;
void *usr_ptr; /* user expansion pointer */
uchar usr_exp[4]; /* user expansion space */
/* DO NOT USE BELOW VARIABLES */
void *sys_ptr; /* system expansion pointer */
uchar sys_exp[4]; /* system expansion space */
} WINDOW;`co();
This structure is used by the UltraWin library for all window
operations. The structure is used internally by the library, so the
information above is mainly shown to satisfy any curiosity.
Starting with version 2.00 of UltraWin, the tabs for the window are
allocated on window creation. The tabs are now as large as the width of
the window, saving space over the 132 bytes used by previous versions. You
will notice that starting with 2.00 both user-defined and system pointers
and expansion areas have been added. Please do not access the system
additions as we will be using these in future versions.
It is recommended that these structure elements be accessed by the
functions provided, where available, and not directly. This allows us to
change and enhance the package in the future while maintaining
compatibility with your code.
`co(10,1);/// EVENT`co();
`co(11,1); typedef struct event_struct
{
int is_mouse;
int key;
int mod;
int m_x, m_y;
int m_count, m_button;
} EVENT;`co();
This structure is used by the global variable "Event", which is used by
wait_event and event_pending to return information.
The "is_mouse" member is used as a boolean to indicate if the event was
a keyboard event (is_mouse=0) or a mouse event (is_mouse=1).
The "key" member will contain the key value, and the member "mod" will
contain bit settings to indicate if a key combination was used. This
includes the left and right shift combinations, Ctrl or Alt combinations,
and whether Scroll Lock, Num Lock, or Caps Lock are set (see UW_KEYS.H for
defines).
The "m_x" and "m_y" members will contain the x,y coordinate (from
0..V_cols-1 for x, 0..V_rows-1 for y) of the mouse event, "m_count" will
contain the number of presses, and "m_button" has the define for the
button pressed (LB, MB, or RB).
`co(10,1);/// M_RESET`co();
`co(11,1); typedef struct reset_struct
{
int exists;
int n_buttons;
} M_RESET;`co();
This structure is used internally by the init_mouse and end_mouse
functions. It is used when starting or ending the program, and when first
called returns whether or not the mouse is available. The function
init_mouse uses this structure to set the global Mouse_exists boolean
variable.
`co(10,1);/// M_LOC`co();
`co(11,1); typedef struct loc_struct
{
int button_status;
int count;
int col;
int row;
} M_LOC;`co();
This structure is used by m_pos, m_pressed, and m_released, as well as
internally by event_pending. If you want to handle the mouse yourself,
bypassing UltraWin's event handling capability, use the m_pos, m_pressed
and m_released functions to get mouse pressed and coordinate information
using a variable of type M_LOC.
`co(10,1);/// M_MOVE`co();
`co(11,1); typedef struct move_struct
{
int h_count;
int v_count;
} M_MOVE;`co();
This structure is used only by the m_motion function, which reports the
net movement of the mouse cursor between m_motion calls.
`co(10,1);/// MENU`co();
`co(11,1); typedef struct menu_struct
{
WINDOW *wnp; /* the window for output */
int direction; /* menu direction, vt or hz */
int num_entries; /* number of entries in menu */
uchar csr_att; /* the cursor attribute */
uchar first_att; /* the first letter attribute */
int csr_pos; /* current cursor position */
uchar first_pos[M_MAX_ENTRIES]; /* first letter position */
int id[M_MAX_ENTRIES]; /* id value for each entry */
uchar x[M_MAX_ENTRIES]; /* x location for each entry */
char *entry[M_MAX_ENTRIES]; /* array of char pointers */
} MENU;`co();
This structure is used internally by the UltraWin menuing functions. The
function `keyword(menu_create,[uw_help4.hlp]/// menu_create); sets up the window, direction, and attribute members,
while `keyword(item_add,[uw_help4.hlp]/// item_add); sets the entry string, id, first position for the hot key,
the x position (used when the menu is horizontal) and increments
num_entries. Once the menu has been constructed with menu_create and
item_add, you may modify the structure directly to change colors, first
positions for hot keys, or an id or menu string on the fly.
For example, to change the third entry of the menu pointed to by mnp to
the words "Load File" with the 'F' character as the hot key with an id
of 32, use:
mnp->first_pos[2] = 5; /* first letter in "File" */
mnp->id[2] = 32; /* the new id */
mnp->entry[2] = "Load File"; /* the new string */
`co(10,1);/// PRINT`co();
`co(11,1); typedef struct printer
{
int active; /* set to 1 if printer init'd/active */
int halt; /* set to 1 to temporarily stop printer */
int prt_dev; /* file handle for printer device */
char device[81]; /* name of printer device */
int prt_buff[2]; /* file handles for printer buffer */
char buffer[81]; /* name of printer buffer */
int cr_cnt; /* number of carriage returns to send */
int lf_cnt; /* number of line feeds to send */
int block_mode; /* allows faster output on block devices*/
long max_que_size; /* maximum size of print que */
long init_que_size; /* initial size of print que */
long curr_que_size; /* current size of print que */
long read; /* print que read index */
long write; /* print que write index */
long cnt; /* print que cnt (number of bytes in q) */
uchar *que; /* pointer to print que data */
uchar *xlat; /* pointer to translation table */
int xlat_flag; /* translation flag */
} PRINT;`co();
This structure is used by the print routines in UW_PRINT.C. For further
information, see `keyword(Print Support,[uw_help6.hlp]/// Print Support);.
`co(10,1);/// Video Globals`co();
`co(11,1); uchar far *Screen;`co();
This is a far pointer to the video display area. Its value will depend
on if you are using a monochrome or color display, and whether a control
program like Windows or Desqview is being used. You may modify this
variable to redirect output anywhere in memory, but be careful to use an
area you are sure is safe.
`co(11,1); int V_mode;`co();
This is an integer that contains the text mode that was used before the
call to init_video or force_video. This is saved in V_mode and is used in
the call to end_video to restore the original mode.
`co(11,1); int V_cols, V_rows;`co();
These two variables contain the number of columns and rows available on
the text screen, and are set by the init_video and force_video functions.
The video screen is therefore defined as 0..V_cols-1 and 0..V_rows-1.
`co(10,1);/// Event Globals`co();
`co(11,1); EVENT Event;`co();
This global variable is used by the event_pending and wait_event
functions to pass back information about the type of event as well as
mouse/keyboard information.
`co(11,1); int Mouse_exists;`co();
This global variable is set by the init_mouse function to either TRUE
(1) or FALSE (0) depending on whether a Microsoft or compatible mouse is
connected.
`co(10,1);/// Default Attributes`co();
`co(11,1); uchar Dflt_att, Dflt_bdr_att;`co();
These attributes are used to set the default window colors when
wn_create is called. If you do not use the wn_color and wn_bdr_color
macros to set the window colors, you will get these default attributes.
`co(10,1);/// Cursor Globals`co();
`co(11,1); int Csr_visible;`co();
This boolean is either TRUE (1) or FALSE (0) depending on whether the
hardware cursor is visible.
`co(11,1); int Csr_in_use;`co();
This boolean is either TRUE (1) or FALSE (0) depending on whether the
hardware cursor is being used. The window input routines wn_gets and
wn_gets_ll set this variable to TRUE while the cursor is being used, then
set it back to FALSE when finished.
`co(10,1);/// DesqView Globals`co();
`co(11,1); int DV_seg, DV_off, DV_flag, DV_upd;`co();
These are integers that are used to maintain DesqView compatibility.
They are used internal to the library.
`co(10,1);/// Manager Globals`co();
`co(11,1); WINDOW *First_window, *Last_window`co();
These are pointers to the first and last windows in the window manager's
linked list. These are NULL on startup, and are set by the link_window and
unlink_window functions as windows are added to the manager. You can use
these to determine the top window (Last_window) or the bottom window
(First_window) at any time when using the manager.
`co(11,1); int Num_windows`co();
This is a count of the number of windows in the window manager. It is 0
on startup, and increments for every link_window call.
`co(10,1);/// Function Globals`co();
`co(11,1); int (*Idle_func)(void) `co();
This is the function that UltraWin calls when it is idle, waiting for an
event. You may set your own idle function by calling set_idle_func with
the name of your function. To take advantage of the background printing
capability of UltraWin you could call `keyword(set_idle_func,[UW_HELP3.HLP]/// set_idle_func); with the function
name print_in_background.
`co(11,1); int (*Key_func)(int, int) `co();
This is a function pointer hook into the UltraWin key handler. It gets
set by the set_key_func function, and points to a user-defined key routine.
See `keyword(set_key_func,[UW_HELP3.HLP]/// set_key_func); for further details.
`co(11,1); int (*Vld_func)(char*, char*, char*, int, int, WINDOW*) `co();
This is a function pointer to the wn_gets_ll string entry validation
routine. It is useful when you want to perform extra error checking
on a particular field (as in a valid date). Refer to `keyword(Data Entry,[uw_help4.hlp]/// Data Entry);
for more information.
`co(11,1); int (*Gets_hook_func)(char*, char*, char*, int, int, int, EVENT*, WINDOW*) `co();
This is a function pointer to the new wn_gets_ll hook. It is set with
the set_gets_hook function, and is called from within wn_gets_ll. With
this function you can customize wn_gets_ll "on the fly." The function is
called on entry, before exiting and on every keystroke. You can modify
the passed string, mask and template dynamically, as well as return your
own key values. This gives you the ability to customize string entry in
virtually any way imaginable! Again refer to `keyword(Data Entry,[uw_help4.hlp]/// Data Entry); for more
information.
`co(10,1);/// Printer Globals`co();
`co(11,1); PRINT *Printers[MAX_PRINTERS]`co();
This is an array of MAX_PRINTERS (4) pointers to PRINT structures for
use in UltraWin's powerful print queue routines. Refer to `keyword(Print Support,[uw_help6.hlp]/// Print Support);
for more information.
`co(10,1);/// Timer Globals`co();
`co(11,1); int Uw_timers[4]`co();
These are four user timers, which count down toward zero every timer tick
from the value you set. For example, if you call init_clock with a value
of 0x3333, then to set a one second count-down timer, just use
Uw_timer[1] = 91; and after 91 ticks (one second) this second member of
the array will reach zero. This occurs even when you are executing your
own code as it is modified during the timer interrupt.
`co(11,1); int Sys_timers[2], int Sound_timer`co();
These are timers used internally for system timers and the tone
function. Access the Uw_timers rather than these for your own use.
`co(11,1); int Sound_on`co();
This is a boolean variable that is 1 if the PC speaker is currently
sounding a tone, or 0 if it is off. This variable is used internally by
tone.
`co(11,1); ulong Tics`co();
This is an unsigned long which counts the number of timer ticks since
the call to init_clock. With init_clock(0x3333), Tics will increment 91
times every second. You may access this variable in your own program for
timing, or reset it to 0 if you want a "count up" timer.
`co(11,1); int Tics_per_sec`co();
This is an integer set in init_clock that specifies the number of ticks
per second. For init_clock(0x3333), this number will be 91.
`co(10,1);/// Graphics Globals`co();
`co(11,1); int Graphics`co();
This is a boolean flag set by init_uw_graphics. When the graphics flag
is set, all UltraWin output goes through g_ch. Please refer to
`keyword(Graphics Support,[uw_help5.hlp]/// Graphics Support); for a complete discussion of using UltraWin in
graphic modes.
`co(11,1); int G_opt`co();
This is a boolean flag which specifies whether output optimization
should be performed in g_ch. If this flag is set, UltraWin checks the
contents of each cell to see if output is necessary before performing the
output. This can result in a very substantial increase in speed. Again
refer to `keyword(Graphics Support,[uw_help5.hlp]/// Graphics Support); for more information.
`co(10,1);/// EGA/VGA Globals`co();
`co(11,1); int Ega`co();
This is a boolean which is set to 1 when an EGA board is detected by
init_video. A VGA board will cause a value of 0.
`co(11,1); int Vga`co();
This is a boolean which is set to 1 when a VGA board is detected by
init_video. An EGA only board will cause a value of 0.
`co(11,1); int EgaVga`co();
This is a boolean which is set to 1 when a board capable of either EGA
or VGA is detected by init_video.
For more information about EGA/VGA support, see `keyword(Font/EGA Control,[uw_help5.hlp]/// Font/EGA Control);
`co(4,7);────────────────────────── /// Video Initialization ──────────────────────────`co();
┌──────────────────────────────────────────────────────────────────────────┐
│ `keyword(init_video,/// init_video); `keyword(force_video,/// force_video); │
│ `keyword(end_video,/// end_video); `keyword(set_vid_addr,/// set_vid_addr); │
└──────────────────────────────────────────────────────────────────────────┘
These functions allow you to initialize the text screen to a specific
mode, and return back to the mode in use before the initialization.
Initialization of the text screen is the first step that should be taken
in a C program that utilizes the UltraWin library.
The UltraWin library supports 80x25 Monochrome and Color modes, as well
as the 80x43 EGA color and 80x50 VGA color mode. Higher resolution text
screens that some of the new VGA cards can produce are also supported.
`co(10,1);/// init_video`co(); `keyword(source,[UW_VID.C]~init_video);
Initializes the text screen to a specific mode, specified not by mode
number, but by number of columns and rows. The video mode that best
matches the number of columns and rows passed will be selected. The
function will set the two global variables V_cols and V_rows to the actual
number that are available. This allows the user to specify an 80x50
screen, and have init_video set the closest text mode to this size that
your video card will accomodate.
Prototype:
void init_video(int cols, int rows);
Parameters:
`co(11,1); int cols, int rows`co();
The number of columns and rows desired for the screen.
Usage:
init_video( 80, 50 );
`co(10,1);/// force_video`co(); `keyword(source,[UW_VID.C]~force_video);
This function is similar to init_video, except the text bios mode number
is passed as well as the number of columns and rows. This allows one of
the non-standard VGA modes (specific to your VGA card) to be set.
Prototype:
void force_video( int force_mode, int cols, int rows );
Parameters:
`co(11,1); int force_mode`co();
The actual mode number listed in the manual for your video board.
`co(11,1); int cols, int rows`co();
The number of columns and rows desired for the screen.
Usage:
force_video( 0x60, 132, 60 );
`co(10,1);/// end_video`co(); `keyword(source,[UW_VID.C]~end_video);
Restores the video mode in use before the call to init_video. Call this
function just before you exit your program.
Prototype:
void end_video(void);
Parameters:
None.
Usage:
end_video();
`co(10,1);/// set_vid_addr`co(); `keyword(source,[UW_VID.C]~set_vid_addr);
This routine overrides the default video address and sets it to the
desired segment and offset.
Prototype:
void set_vid_addr( int segment, int offset );
Parameters:
`co(11,1); int segment, offset`co();
The desired segment and offset for your new video address.
Usage:
`co(11,1); uchar far *old_screen;`co();
...
old_screen = Screen;
set_vid_addr( 0xB000, 0x8000 );
...
Screen = old_screen;
`co(4,7);───────────────────────────── /// Window Basics ──────────────────────────────`co();
┌──────────────────────────────────────────────────────────────────────────┐
│ `keyword(wn_create,/// wn_create); `keyword(wn_set,/// wn_set); │
│ `keyword(wn_clear,/// wn_clear); `keyword(wn_border,/// wn_border); │
│ `keyword(wn_move,/// wn_move); `keyword(wn_size,/// wn_size); │
│ `keyword(wn_destroy,/// wn_destroy); │
│ `keyword(set_mask,/// set_mask); `keyword(clear_mask,/// clear_mask); │
└──────────────────────────────────────────────────────────────────────────┘
These are the functions used for basic window creation, destruction, and
placement on the text screen. There are special functions that allow you
to "mask off" sections of a window so that output does not occur to that
area, as well as restoring what was behind a window when it was created.
`co(10,1);/// wn_create`co(); `keyword(source,[UW_WN.C]~wn_create);
Creates a window with the size determined by the upper left and lower
right coordinates passed by integer. Several border styles can be used,
as well as a mode for saving what is behind the window, to be restored on
window destruction. Please note that wn_create does not allocate the
window structure for you. You must declare your window structures as
either locals or globals, passing the address of the window to wn_create,
or as pointers returned from malloc or calloc. A 1 is returned on
success, and a 0 on failure.
Prototype:
int wn_create( int x_min, int y_min, int x_max, int y_max, int bdr,
int mode, WINDOW *wnp );
Parameters:
`co(11,1); int x_min, int y_min, int x_max, int y_max`co();
The coordinates of the upper left and lower right corners of the window
to create. These range from 0,0 (upper left corner of the screen) to
the max number of columns and rows minus one (lower right corner of the
screen).
`co(11,1); int bdr`co();
The border style to use, namely one of the defines NO_BDR, SGL_BDR,
DBL_BDR, SLD_BDR, or DUAL_BDR.
`co(11,1); int mode`co();
The popup mode, can be either WN_NORMAL or WN_POPUP. Normal windows
when destroyed do not restore what is behind them, while popup windows
do. Normal windows therefore use less memory.
`co(11,1); WINDOW *wnp`co();
A pointer to the window. Can be the address of a global variable of
type WINDOW, or a pointer that has been allocated with malloc or calloc.
The wn_create function will initialize the contents of the window for
you, so all that is necessary is to pass it to this function.
Usage:
WINDOW *wnp;
...
wn_create( 0, 0, 79, 24, SGL_BDR, POPUP, wnp );
`co(10,1);/// wn_set`co(); `keyword(source,[UW_WN.C]~wn_set);
Sets the window on the screen, saving the contents of what is behind the
window if it was defined as WN_POPUP when created with wn_create.
Prototype:
void wn_set( WINDOW *wnp );
Parameters:
`co(11,1); WINDOW *wnp`co();
A pointer to the window, or address of a WINDOW variable.
Usage:
WINDOW *wnp;
...
wn_set( wnp );
`co(10,1);/// wn_clear`co(); `keyword(source,[UW_WN.C]~wn_clear);
Clears the contents of a window, excluding the border, if present. The
window must be first created with wn_create, then set on the video screen
with wn_set.
Prototype:
void wn_clear( WINDOW *wnp );
Parameters:
`co(11,1); WINDOW *wnp`co();
A pointer to the window.
Usage:
WINDOW *wnp;
...
wn_clear( wnp );
`co(10,1);/// wn_border`co(); `keyword(source,[UW_BDR.C]~wn_border);
Draws the border to the window, if the window border exists (call
wn_create with something besides NO_BDR, or set the bdr_style field of the
window to one of the border defines). Use this function to redraw the
border.
Prototype:
void wn_border( WINDOW *wnp );
Parameters:
`co(11,1); WINDOW *wnp`co();
A pointer to the window.
Usage:
WINDOW *wnp;
...
wn_border( wnp );
`co(10,1);/// wn_move`co(); `keyword(source,[UW_WN.C]~wn_move);
Takes a window that has been placed on the video screen with wn_set, and
moves it to a new location. Please note that the background will be
restored for you when the window is moved if you create the window with
the WN_POPUP value as the mode parameter to wn_create.
Prototype:
void wn_move( int col, int row, WINDOW *wnp );
Parameters:
`co(11,1); int col, row`co();
The column and row where the window is to be moved. This location is
where the upper left hand corner of the window will be placed.
`co(11,1); WINDOW *wnp`co();
A pointer to the window to move.
Usage:
WINDOW *wnp;
...
wn_move( 3, 7, wnp );
`co(10,1);/// wn_size`co(); `keyword(source,[UW_WN.C]~wn_size);
Takes a window that has been placed on the video screen with wn_set, and
resizes it, either smaller or larger. The window can also be moved in the
same operation. Please note that the background will be restored for you
when the window is sized if you create the window with the WN_POPUP value
as the mode parameter to wn_create.
IMPORTANT: The contents of the window are destroyed in this operation.
Since the window changes size, it is typically necessary to redisplay
the contents to take advantage of the new size.
Prototype:
int wn_size( int x_min, int y_min, int x_max, int y_max, WINDOW *wnp );
Parameters:
`co(11,1); int x_min, int y_min, int x_max, int y_max`co();
The coordinates of the upper left and lower right corners of the window
to create. These range from 0,0 (upper left corner of the screen) to
the max number of columns and rows minus one (lower right corner of the
screen).
`co(11,1); WINDOW *wnp`co();
A pointer to the window to move.
Usage:
WINDOW *wnp;
...
wn_size( 3, 7, 74, 18, wnp );
`co(10,1);/// set_mask`co(); `keyword(source,[UW_MASK.C]~set_mask);
Checks to see if the second window (top) overlaps the first window
(bottom), and masks off (for output) the area that overlaps. Call this
function when a window is added on top of another window. If the windows
are not overlapped, then no masking is necessary, and the mask is not
performed. Masking the bottom window prevents output to the region of the
bottom window overlapped, giving the appearance that the window updates
"in the background". Call set_mask on a window for each window that is to
be displayed "on top" of it. You do not need to use this function when
using the window manager, as it takes care of all masking when a window is
added or removed!
Prototype:
void set_mask( int mode, WINDOW *wnp1, WINDOW *wnp2 );
Parameters:
`co(11,1); int mode`co();
A value 1 (ON) or 0 (OFF) to indicate if the mask is to be added
or removed.
`co(11,1); WINDOW *wnp1`co();
The window for which the mask is to be set (the bottom window).
`co(11,1); WINDOW *wnp2`co();
The window used to set the mask of the bottom window. (the top window).
Usage:
WINDOW bottom_win, top_win;
...
set_mask(ON, &bottom_win, &top_win);
set_mask(OFF, &bottom_win, &top_win);
`co(10,1);/// clear_mask`co(); `keyword(source,[UW_MASK.C]~clear_mask);
Clears the mask for the window passed. All areas of the window will
change when the window is refreshed, or when any information is written to
the window, the window scrolls, etc. The window manager will clear any
masks necessary when you add or delete windows.
Prototype:
void clear_mask( WINDOW *wnp );
Parameters:
`co(11,1); WINDOW *wnp1`co();
A pointer to type WINDOW that specifies the window to clear.
Usage:
WINDOW win;
...
clear_mask( &win );
`co(10,1);/// wn_destroy`co(); `keyword(source,[UW_WN.C]~wn_destroy);
Restores what was behind the window before wn_create (if it was defined
using WN_POPUP), and deallocates memory used by the window. Be sure you
destroy any temporary window that you have created with wn_create, or you
will consume valuable memory. This is also good practice at the end of
your program, before calling end_video and returning to DOS.
Prototype:
void wn_destroy( WINDOW *wnp );
Parameters:
`co(11,1); WINDOW *wnp`co();
A pointer to the window, or address of a WINDOW variable.
Usage:
WINDOW *wnp;
...
wn_destroy( wnp );